package com.ruoyi.system.service.impl;

import java.util.HashMap;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.QQuestionnaireAnswerMapper;
import com.ruoyi.system.domain.QQuestionnaireAnswer;
import com.ruoyi.system.service.IQQuestionnaireAnswerService;

/**
 * 问卷答案Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-10
 */
@Service
public class QQuestionnaireAnswerServiceImpl implements IQQuestionnaireAnswerService 
{
    @Autowired
    private QQuestionnaireAnswerMapper qQuestionnaireAnswerMapper;

    /**
     * 查询问卷答案
     * 
     * @param answerId 问卷答案主键
     * @return 问卷答案
     */
    @Override
    public QQuestionnaireAnswer selectQQuestionnaireAnswerByAnswerId(Long answerId)
    {
        return qQuestionnaireAnswerMapper.selectQQuestionnaireAnswerByAnswerId(answerId);
    }

    /**
     * 查询问卷答案列表
     * 
     * @param qQuestionnaireAnswer 问卷答案
     * @return 问卷答案
     */
    @Override
    public List<QQuestionnaireAnswer> selectQQuestionnaireAnswerList(QQuestionnaireAnswer qQuestionnaireAnswer)
    {
        return qQuestionnaireAnswerMapper.selectQQuestionnaireAnswerList(qQuestionnaireAnswer);
    }

    /**
     * 新增问卷答案
     * 
     * @param qQuestionnaireAnswer 问卷答案
     * @return 结果
     */
    @Override
    public int insertQQuestionnaireAnswer(QQuestionnaireAnswer qQuestionnaireAnswer)
    {
        qQuestionnaireAnswer.setCreateTime(DateUtils.getNowDate());
        return qQuestionnaireAnswerMapper.insertQQuestionnaireAnswer(qQuestionnaireAnswer);
    }

    /**
     * 修改问卷答案
     * 
     * @param qQuestionnaireAnswer 问卷答案
     * @return 结果
     */
    @Override
    public int updateQQuestionnaireAnswer(QQuestionnaireAnswer qQuestionnaireAnswer)
    {
        qQuestionnaireAnswer.setUpdateTime(DateUtils.getNowDate());
        return qQuestionnaireAnswerMapper.updateQQuestionnaireAnswer(qQuestionnaireAnswer);
    }

    @Override
    public HashMap findstatistics() {
        return qQuestionnaireAnswerMapper.findstatistics();
    }

    /**
     * 批量删除问卷答案
     * 
     * @param answerIds 需要删除的问卷答案主键
     * @return 结果
     */
    @Override
    public int deleteQQuestionnaireAnswerByAnswerIds(Long[] answerIds)
    {
        return qQuestionnaireAnswerMapper.deleteQQuestionnaireAnswerByAnswerIds(answerIds);
    }

    /**
     * 删除问卷答案信息
     * 
     * @param answerId 问卷答案主键
     * @return 结果
     */
    @Override
    public int deleteQQuestionnaireAnswerByAnswerId(Long answerId)
    {
        return qQuestionnaireAnswerMapper.deleteQQuestionnaireAnswerByAnswerId(answerId);
    }
}
